<%-- 
    Document   : editworkProject
    Created on : Jul 28, 2012, 10:42:22 AM
    Author     : VANANH
--%>


<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@taglib prefix="rich" uri="http://richfaces.org/rich" %>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j" %>
<%@taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<html>
    <head>
        <link rel="stylesheet" type="text/css" href="../css/popup.css"/>
        <link rel="stylesheet" type="text/css" href="../css/kapiform.css"/>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/jq.date.js"></script>  
        <link rel="stylesheet" type="text/css" href="../css/ui.datepicker.css"/>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/jquery.rateit.js"></script>

        <link rel="stylesheet" type="text/css" href="../css/rateit.css">
    </head>
    <script type="text/javascript">
        var open_cur = 0;
        $j = jQuery.noConflict();
        $j(document).ready(function(){
            
            
            $j('input#to').datepicker({ dateFormat: 'dd/mm/yy', showOn: 'button', buttonImage: '../images/calenda_icon.gif', buttonImageOnly: true }); 
            $j('input#from').datepicker({ dateFormat: 'dd/mm/yy', showOn: 'button', buttonImage: '../images/calenda_icon.gif', buttonImageOnly: true }); 
           
            validateform("form-input-customer");
            
            $j(".rateit").bind('rated', function (event, value) { 
                var pk100 = $j(this).attr('lang');
               
                star_value = value;
                       
                $j.post("starofsupplier.jsp?action=favourite&flag=starcustomer&sn354="+star_value+'&pk100='+pk100,function(){

                });
            });
            $j('.close').live('click', function(){
                var pk100 = $j(this).attr('lang');
                
                lDateTime = new Date().getTime();
                window.location.href="supplier.jsp?tab=tab6"+ pk100 +"&flag="+lDateTime+"&#"+ pk100 +"";
            });
            $j('.close4').live('click', function(){
                var pk100 = $j(this).attr('lang');
                       
                lDateTime = new Date().getTime();
                window.location.href="cuscompany.jsp?tab=tab9"+ pk100 +"&flag="+lDateTime+"&#"+ pk100 +"";
            });
            //            $j('#fancybox-close').live('click', function(){
            //               var dymamic = $j('.title').attr('lang');
            //                window.location.href="supplier.jsp?tab=tab6"+ dymamic +"&flag=1352081223438&#"+ dymamic +"";
            //            });
            $j('.close1').live('click', function(){
                $j('.message').delay(7000).fadeOut('slow');
            });
            $j('#fancybox-close').live('click', function(){
                fk100 = '<c:out value="${v300Controller.fk100}"/>';
                lDateTime = new Date().getTime(); 
                window.location.href="supplier.jsp?tab=itemcontent"+ fk100 +"&flag="+lDateTime+"&#"+ fk100 +"";
            });
             
            
              
        });

    </script>
    <style type="text/css">

        #ui-datepicker-div
        {
            z-index: 9999999;
        }
        html{visible : true}

        .bg_department{
            height: 68px !important;
        }

        .feild_sex tr td {
            float:left !important;
            width: 80px !important; 
            height: 20px;

        }
        .feild_sex tr td label {
            text-align: center !important;
            width: 88px !important; 
            color: black;
            margin-top: 20px;
            font-size: 12px;
            margin-left: -55px;
        }
        .feild_sex tr td input[type="radio"]{
            float:left !important;

        }
        .ui-datepicker-trigger1{
            cursor: pointer;
            position: absolute;
        }
        .itemimg{
            float:left;
            margin-top: -5px;
            width: 50%;

        }
        .field_normal{            
            width:100%; 
        }
        .field_pink{
            background-color: #D1E1F1; 

        }
        .lbl_editWork{
            float: left !important;
            width: 115px !important;
            /*  text-align:right !important;
              
              width: 95px !important;
              padding-top: 10px!important;
              padding-bottom: 0px; */

        }

        .date_editWork{
            width: 250px;
            float: left;
            margin-top: 8px;
        }
        img.ui-datepicker-trigger{
            margin-top: 3px !important;
        }
        .priority_work{
            width:370px;

            float:left;
            color: black;
        }
        .div_null{
            width: 290px;
            height: 20px;
            float: left;
        }
        .select{
            width: 200px !important;
        }
        .message{
            color: red;
            float: left;
            margin-left: 263px;
            margin-top: 13px;
            text-align: center;

        }
        .greyRow{
            background: #E0EFFC;
        }
    </style>
    <f:view>
        <a4j:form id="form-input-customer" >
            <body style=" float:left; width:auto; height:auto; margin:0px;">
                <f:loadBundle basename="#{environmentSession.localizationSource}" var="locale"/>
                <div class="popup" style="height:540px; width:670px">
                    <div class="popup-header">
                        <div class="title"><h:outputText value="Dịch vụ nhà cung cấp"/></div>

                    </div>
                    <div class="popup-content">

                        <div class="main_content">
                            <div class="form_item_content" style="margin-top:15px; margin-left: 0px" >
                                <div class="item_content" style="display:block">
                                    <div  class="field_normal" style="height:40px">
                                        <div class="fields_input">
                                            <label class="lbl_editWork"><h:outputText value="Tên dịch vụ"/> <span>*: </span></label>
                                            <h:inputText value="#{v300Controller.vv301}"  styleClass="required" id="nameservice" style="width:471px;margin-left:1px;" />

                                        </div>


                                    </div>

                                    <div class="field_pink" style="height:75px; " >
                                        <div class="fields_input" >    

                                            <label class="lbl_editWork"><h:outputText value="Loại dịch vụ"/>: </label>                                          
                                            <h:selectOneMenu id="fa000" value="#{v300Controller.fv200}"  styleClass="cbx_editWork" >
                                                <f:selectItems value="#{serviceController.comboV200}" />
                                            </h:selectOneMenu>
                                            <label class="lbl_editWork" style="width:80px !important;"><h:outputText value="Giá dịch vụ"/>:</label>
                                            <h:inputText value="#{v300Controller.vn302Str}" styleClass="required" id="priceservice" style="width:143px;margin-left:1px;text-align:right;" />
                                            <h:selectOneMenu value="#{v300Controller.vv303}"  style="width:65px;margin-left:5px;">  
                                                <f:selectItem itemValue="1" itemLabel="VND" />  
                                                <f:selectItem itemValue="2" itemLabel="USD" />  
                                                <f:selectItem itemValue="3" itemLabel="EUR" />
                                            </h:selectOneMenu>
<!--                                            <label class="lbl_editWork" style="width:80px !important;" ><h:outputText value="Đánh giá"/>:</label>

                                            <div  class="rateit" lang="<h:outputText value='#{serviceController.pk100}'/>" id="<h:outputText value='#{serviceController.pk100}'/>" data-rateit-min="0" data-rateit-value="<h:outputText value='#{serviceController.vn224}'/>"></div>-->
                                        </div>
                                        <div class="fields_input" >
                                            <label class="lbl_editWork"><h:outputText value="Ghi chú"/>: </label>           
                                            <h:inputTextarea value="#{v300Controller.vv304}" style="height:24px; width:471px;" ></h:inputTextarea>
                                            </div>

                                        </div>
                                    </div>
                                    <div class="field_normal" >
                                        <div class="fields_input" >
                                            <label class="lbl_editWork"><h:outputText value="#{locale.description}"/><span>:</span>  </label>


                                        <h:inputTextarea value="#{v300Controller.vv305}" style="height:65px; width:471px; margin-left:1px ; margin-top: 10px" ></h:inputTextarea>
                                        </div>
                                    </div>
                                </div>

                                <div class="popup-footer" style="margin-top: 10px;">
                                    <div class="message"><h:outputText id="message" value="#{v300Controller.messageform}"/> </div>
                                <%--  <h:panelGroup rendered="#{serviceController.tip == 1}">  <div class="buttonsave close"  lang="<h:outputText value='#{serviceController.pk100}'/>" onclick="parent.jQuery.fancybox.close(); " style="margin-right:31px;"  ><span><h:outputText value="#{locale.button_close}"/></span></div></h:panelGroup>
                                    <h:panelGroup rendered="#{serviceController.tip == 0}">  <div class="buttonsave close4"  lang="<h:outputText value='#{serviceController.pk100}'/>" onclick="parent.jQuery.fancybox.close(); " style="margin-right:31px;"  ><span><h:outputText value="#{locale.button_close}"/></span></div></h:panelGroup>
                                --%>
                                <a4j:commandButton id="aaaaa"  value='#{locale.save}' action="#{v300Controller.updateV300}"
                                                   onclick=" showPleaseWait();"
                                                   oncomplete="hidePleaseWait();"
                                                   styleClass="buttonsave close1" reRender="message, nameservice, N1000, a000, table, fa000">

                                </a4j:commandButton>
                                <h:inputHidden value="#{v300Controller.fk100}" id="fk100"/> 
                                <h:inputHidden value="#{v300Controller.pv300}" id="pv300"/> 
                                <%--
                                                            <h:inputHidden value="#{serviceController.pv220}" id="PS350"/>
                                                            <h:inputHidden value="#{serviceController.pk100}" id="pk100"/> 
                                                            <h:inputHidden value="#{serviceController.tip}" id="tip"/>
                                --%>
                            </div>
                            <div style="float: left;height: 180px;width: 96%;margin-left: 13px;margin-top: 12px;overflow-y: scroll;overflow-x: scroll">
                                <rich:dataTable  reRender="sc2" value="#{v300Controller.listV300All}" var="item"                            
                                                 rowClasses="greyRow, whiteRow"
                                                 columnClasses=",columns,columns,columns" rowKeyVar="row"
                                                 id="table" styleClass="machinePosDataTable">
                                    <rich:column style="width:15px;">
                                        <f:facet name="header">
                                            <h:outputText value="STT" />
                                        </f:facet>

                                        <div style="width:15px;text-align: center">
                                            <h:outputText value="#{row+1}" />    
                                        </div>
                                    </rich:column>
                                    <rich:column style="width: 200px;" >
                                        <f:facet name="header">
                                            <h:outputText value="Tên dịch vụ" />
                                        </f:facet>

                                        <div style="width: 200px;text-align: left">
                                            <h:outputText value="#{item.vv301} " />    
                                        </div>
                                    </rich:column>
                                    <rich:column style="width:160px;">
                                        <f:facet name="header">
                                            <h:outputText  value="Loại dịch vụ" />
                                        </f:facet>
                                        <div style="width:60px;">
                                            <h:outputText value="#{item.vv201}" />    
                                        </div>
                                    </rich:column>

                                    <rich:column style="width:80px;">
                                        <f:facet name="header">
                                            <h:outputText  value="Giá dịch vụ" />
                                        </f:facet>
                                        <div style="width:80px;text-align: right">
                                            <h:outputText   value="#{item.vn302Str}" />

                                        </div>
                                    </rich:column>
                                    <rich:column style="width:32px;">
                                            <f:facet name="header">
                                                <h:outputText  value="Tiền tệ" />
                                            </f:facet>
                                            <div style="width:32px;text-align: center;">
                                                <h:panelGroup rendered="#{item.vv303==1}">  <h:outputText   value="VNĐ" /></h:panelGroup>
                                                <h:panelGroup rendered="#{item.vv303==2}">  <h:outputText   value="USD" /></h:panelGroup>
                                                <h:panelGroup rendered="#{item.vv303==3}">  <h:outputText   value="EUR" /></h:panelGroup>

                                            </div>
                                        </rich:column>
                                    <rich:column style="width:150px;">
                                        <f:facet name="header">
                                            <h:outputText  value="Ghi chú" />
                                        </f:facet>
                                        <div style="width:150px;text-align: right">
                                            <h:outputText   value="#{item.vv304}" />

                                        </div>
                                    </rich:column>
                                    <rich:column style="width:150px;">
                                        <f:facet name="header">
                                            <h:outputText  value="Mô tả" />
                                        </f:facet>
                                        <div style="width:150px;text-align: right">
                                            <h:outputText   value="#{item.vv305}" />

                                        </div>
                                    </rich:column>


                                </rich:dataTable>
                            </div>
                            <div class="alert"></div>    
                        </div>



                    </div>          
            </body>
        </a4j:form>
    </f:view>
</html>
<script type="text/javascript">
    $j(document).ready(function(){
        yhight = ($j('.popup').height()-90)+"px" ;
        $j('.main_content').css('height',yhight );
        $j('.popup-content').css('height',yhight );
        
        
    });
</script>

